<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
      <input type="checkbox">
</body>
</html>
<script>
     //focus、blur、change----聚焦、失去焦点
     //获取DOM
     let input = document.querySelector('input');
     //change事件：经常与表单元素一起使用，当文本发生变化的时候会出发
     input.onchange = function(){
         console.log('change事件');
     }
</script>
